import os
import time


def TimeStampToTime(timestamp):
    timeStruct = time.localtime(timestamp)
    return time.strftime('%Y-%m-%d %H:%M:%S', timeStruct)

def get_FileModifyTime(filePath):
    # '''获取文件的修改时间'''
    t = os.path.getmtime(filePath)
    return TimeStampToTime(t)

def get_subFile(filePath):
    d = {}
    for file_name in os.listdir(filePath):
        d[file_name] = get_FileModifyTime(filePath+"\\"+file_name)
    return d


if __name__ == '__main__':
    path = r"H:\Python36\Lib\site-packages"
    print(get_subFile(path))
    
